<template>
  <!-- 底部 -->
  <div class="my-footer">
    <!-- 全选 -->
    <div class="custom-control custom-checkbox">
      <input
        type="checkbox"
        :checked="FouterState"
        @change="changeSatae"
        class="custom-control-input"
        id="footerCheck"
      />
      <label class="custom-control-label" for="footerCheck">全选</label>
    </div>
    <!-- 合计 -->
    <div>
      <span>合计:</span>
      <span class="price">¥ {{ FouterSum }}</span>
    </div>
    <!-- 按钮 -->
    <button type="button" class="footer-btn btn btn-primary">结算 ( {{ FouterAll }} )</button>
  </div>
</template>

<script>
export default {
  props: {
    // 全部价格
    FouterSum: {
      type: Number,
      default: 0
    },
    // 全选状态
    FouterState: {
      type: Boolean,
      default: false
    },
    FouterAll: {
      type: Number,
      default: 0
    }
  },
  methods: {
    // 监听全选状态
    changeSatae(e) {
      // 传给父组件 MyGoos
      this.$emit('changesatae', e.target.checked)
    }
  }
}
</script>

<style lang="less" scoped>
.my-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  bottom: 40px;
  width: 100%;
  height: 50px;
  border-top: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  background: #fff;

  .price {
    color: red;
    font-weight: bold;
    font-size: 15px;
  }
  .footer-btn {
    min-width: 100px;
    height: 35px;
    line-height: 35px;
    border-radius: 25px;
    padding: 0;
  }
}
</style>
